home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WWindow -- Base Window class
- *
- *
- * Events:
- *
- * Activate --
- *
- * ActivateApplication --
- *
- * AfterProcessing --
- *
- * BeforeProcessing --
- *
- * CalculateSize --
- *
- * CharacterPress --
- *
- * Close --
- *
- * Command --
- *
- * CompareItem --
- *
- * ContextHelp --
- *
- * ContextMenu --
- *
- * ControlColor --
- *
- * Create --
- *
- * Deactivate --
- *
- * DeleteItem --
- *
- * Destroy --
- *
- * DeviceChange --
- *
- * DisplayChange --
- *
- * DockingChange --
- *
- * DragContinue -- When a drag-and-drop operation is about to continue
- *
- * DragDrop -- When a drag-and-drop operation has been accepted
- *
- * DragEnd -- When a drag-and-drop operation has ended
- *
- * DragEnter -- When a drag-and-drop operation has been entered
- *
- * DragFeedback -- When a drag-and-drop operation requests feedback
- *
- * DragFill --
- *
- * DragLeave -- When a drag-and-drop operation is about to end
- *
- * DragOver -- When a window is currently a candidate for a
- * drag-and-drop operation
- *
- * DragScroll -- When a drag-and-drop operation is about to scroll
- *
- * DragStart -- When a drag-and-drop operation has started
- *
- * DrawItem -- When an item is to be drawn
- *
- * DropFile -- When a window has been the recipient of a file
- * drag-and-drop operation
- *
- * EndSession --
- *
- * EnterIdle -- When a child modal dialog box or menu enters an idle
- * state
- *
- * EnterSizeMove --
- *
- * EraseBackground -- When the background of the window needs painting
- *
- * ExitSizeMove --
- *
- * GetCursor --
- *
- * GotFocus -- When a window has received the focus
- *
- * Help -- When help is requested (i.e. F1 is pressed)
- *
- * Hide --
- *
- * HitTest --
- *
- * InitMenu --
- *
- * InitPopupMenu --
- *
- * InputLangChange --
- *
- * InputLangChangeRequest --
- *
- * KeyDown --
- *
- * KeyUp --
- *
- * LeftButtonDown -- When the left mouse button has been depressed
- *
- * LeftButtonDouble -- When the left mouse button double clicked
- *
- * LeftButtonUp -- When the left mouse button has been released
- *
- * LostFocus -- When a window has lost the focus
- *
- * Maximize --
- *
- * MeasureItem --
- *
- * MenuSelect --
- *
- * MiddleButtonDown -- When the middle mouse button has been depressed
- *
- * MiddleButtonDouble -- When the middle mouse button double clicked
- *
- * MiddleButtonUp -- When the middle mouse button has been released
- *
- * Minimize --
- *
- * MouseMove -- When the mouse moves
- *
- * Move -- When the window has moved
- *
- * NeedToolTipText --
- *
- * NonClientPaint --
- *
- * Notify --
- *
- * Paint --
- *
- * PaletteChanged --
- *
- * PositionChanged --
- *
- * PositionChanging --
- *
- * PowerBroadcast --
- *
- * Print --
- *
- * PrintClient --
- *
- * PrivateMessage --
- *
- * QueryEndSession --
- *
- * QueryNewPalette --
- *
- * Resize --
- *
- * RightButtonDown -- When the right mouse button has been depressed
- *
- * RightButtonDouble -- When the right mouse button double clicked
- *
- * RightButtonUp -- When the right mouse button has been released
- *
- * Scroll --
- *
- * SettingChange --
- *
- * Show --
- *
- * SizeChanging --
- *
- * SysColorChange --
- *
- * SysDeadChar --
- *
- * SystemCommand --
- *
- * SystemKeyDown --
- *
- * User -- When a user event is signalled
- *
- * UserChanged --
- *
- *************************************************************************/
-
- #ifndef _WWINDOW_HPP_INCLUDED
- #define _WWINDOW_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #include "wdef.hpp"
- #include "wdrag.hpp"
- #include "winputcx.hpp" // IMM input context
-
- #ifndef _WCALLBACK_HPP_INCLUDED
- # include "wcallbck.hpp"
- #endif
- #ifndef _WKEYDEFS_HPP_INCLUDED
- # include "wkeydefs.hpp"
- #endif
- #ifndef _WOBJECT_HPP_INCLUDED
- # include "wobject.hpp"
- #endif
- #ifndef _WRECT_HPP_INCLUDED
- # include "wrect.hpp"
- #endif
- #ifndef _WSTRING_HPP_INCLUDED
- # include "wstring.hpp"
- #endif
- #ifndef _WCOLOR_HPP_INCLUDED
- # include "wcolor.hpp"
- #endif
- #ifndef _WBRUSH_HPP_INCLUDED
- # include "wbrush.hpp"
- #endif
- #ifndef _WFONT_HPP_INCLUDED
- # include "wfont.hpp"
- #endif
- #ifndef _WEVENTD_HPP_INCLUDED
- # include "weventd.hpp"
- #endif
- #ifndef _WMESSAGE_HPP_INCLUDED
- # include "wmessage.hpp"
- #endif
- #ifndef _WREGION_HPP_INCLUDED
- # include "wregion.hpp"
- #endif
- #ifndef _WSEMAPHORE_HPP_INCLUDED
- # include "wsemaphr.hpp"
- #endif
- #ifndef _WVECTOR_HPP_INCLUDED
- # include "wvector.hpp"
- #endif
- #ifndef _WDRAW_HPP_INCLUDED
- # include "wdraw.hpp"
- #endif
- #ifndef _WKEYBLAY_HPP_INCLUDED
- # include "wkeyblay.hpp"
- #endif
-
- #ifndef _WIN16
- #undef PostMessage
- #undef SendMessage
- #if defined( _UNICODE )
- #define PostMessage PostMessageW
- #define SendMessage SendMessageW
- #else
- #define PostMessage PostMessageA
- #define SendMessage SendMessageA
- #endif
- #endif
-
- class WPopupMenu;
- class WMenu;
- class WCursor;
- class WResourceID;
- class WColor;
- class WFont;
- class WDisplayCanvas;
- class WCanvas;
- class WToolTip;
- class WForm;
- class WControl;
- class WWindow;
- class WHotKey;
- class WDockFloatingForm;
-
- enum WDockPosition {
- WDockNotDocked = 0,
- WDockFloating,
- WDockTop,
- WDockBottom,
- WDockLeft,
- WDockRight
- };
-
- enum WHitTestCode {
- WHTError = -2,
- WHTTransparent = -1,
- WHTNowhere = 0,
- WHTClient = 1,
- WHTCaption = 2,
- WHTSysMenu = 3,
- WHTGrowBox = 4,
- WHTSize = WHTGrowBox,
- WHTMenu = 5,
- WHTHScroll = 6,
- WHTVScroll = 7,
- WHTMinButton = 8,
- WHTMaxButton = 9,
- WHTLeft = 10,
- WHTRight = 11,
- WHTTop = 12,
- WHTTopLeft = 13,
- WHTTopRight = 14,
- WHTBottom = 15,
- WHTBottomLeft = 16,
- WHTBottomRight = 17,
- WHTBorder = 18,
- WHTReduce = WHTMinButton,
- WHTZoom = WHTMaxButton,
- WHTSizeFirst = WHTLeft,
- WHTSizeLast = WHTBottomRight,
- WHTObject = 19,
- WHTClose = 20,
- WHTHelp = 21
- };
-
- enum WDragMode {
- WNoDrag = 0,
- WManualDrag = 1,
- WAutomaticLeftDrag = 2,
- WAutomaticRightDrag = 3,
- };
-
- typedef WUShort WMouseMessage;
-
- /**************************************************
- ******************************************************
- ***************************************************/
-
- enum WDeviceType {
- WDeviceTypeOEM = 0x00000000,
- WDeviceTypeDevNode = 0x00000001,
- WDeviceTypeVolume = 0x00000002,
- WDeviceTypePort = 0x00000003,
- WDeviceTypeNet = 0x00000004,
-
- WDeviceTypeNULL = 0xffffffff
- };
-
- enum WEventType {
- WEventTypeAppyBegin = 0x0000,
- WEventTypeAppyEnd = 0x0001,
- WEventTypeDevNodesChanged = 0x0007,
- WEventTypeQueryChangeConfig = 0x0017,
- WEventTypeConfigChanged = 0x0018,
- WEventTypeConfigChangeCanceled = 0x0019,
- WEventTypeMonitorChange = 0x001b,
- WEventTypeShellLoggedOn = 0x0020,
-
- WEventTypeConfigMGAPI32 = 0x0022,
-
- WEventTypeVolLockQueryLock = 0x8041,
- WEventTypeVolLockLockTaken = 0x8042,
- WEventTypeVolLockLockFailed = 0x8043,
- WEventTypeVolLockQueryUnlock= 0x8044,
- WEventTypeVolLockLockReleased = 0x0045,
- WEventTypeVolLockUnlockFailed = 0x8046,
-
- WEventTypeNoDiskSpace = 0x0047,
- WEventTypeConfigGMGPrivate = 0x7fff,
-
- WEventTypeDevArrival = 0x8000,
- WEventTypeDevQueryMode = 0x8001,
- WEventTypeDevQueryModeFailed= 0x8002,
- WEventTypeDevRemovePending = 0x8003,
- WEventTypeDevRemoveComplete = 0x8004,
- WEventTypeDevTypeSpecific = 0x8005,
-
- WEventTypeVPowerDAPI = 0x8100,
- WEventTypeUserDefined = 0xffff
- };
-
- struct WWindowPlacement {
- WShowStyle showStyle;
- WPoint minimizedPosition;
- WPoint maximizedPosition;
- WRect normalPosition;
- };
-
- struct WDeviceChangeEventData : public WEventData {
- WEventType eventType;
- WDeviceType deviceType;
- };
-
- enum WVolumeLockPermission {
- WVolumeLockPermAllowWrites = 0x01,
- WVolumeLockPermFailWrites = 0x00,
- WVolumeLockPermFailMemMapping = 0x02,
- WVolumeLockPermAllowMemMapping= 0x00,
- WVolumeLockPermUserMask = 0x03,
- WVolumeLockPermLockForFormat= 0x04
- };
-
- enum WVolumeLockFlags {
- WVolumeLockFlagsLogicalLock = 0x00,
- WVolumeLockFlagsPhysicalLock= 0x01
- };
-
- struct WVolumeLockDeviceChangeEventData : public WDeviceChangeEventData {
- WDWord owner;
- WByte permision;
- WByte lockType;
- WByte drive;
- WByte flags;
- };
-
- struct WOEMDeviceChangeEventData : public WDeviceChangeEventData {
- WDWord identifier;
- WDWord suppFunc;
- };
-
-
- struct WDevNodeDeviceChangeEventData : public WDeviceChangeEventData {
- WDWord devNode;
- };
-
- enum WVolumeDeviceChangeFlags {
- WVolumeDeviceChangeMedia = 0x0001,
- WVolumeDeviceChangeNet = 0x0002
- };
-
- struct WVolumeDeviceChangeEventData : public WDeviceChangeEventData {
- WDWord unitMask;
- WUShort flags;
- };
-
- struct WPortDeviceChangeEventData : public WDeviceChangeEventData {
- WString name;
- };
-
- enum WNetDeviceChangeFlags {
- WNetDeviceChangeResource = 0x00000001,
- WNetDeviceChangeXPort = 0x00000002,
- WNetDeviceChangeSlowNet = 0x00000004
- };
-
- struct WNetDeviceChangeEventData : public WDeviceChangeEventData {
- WDWord resource;
- WDWord flags;
- };
-
- struct WUserDefinedDeviceChangeEventData : public WDeviceChangeEventData {
- WString name;
- };
-
- struct WMGAPI32DeviceChangeEventData : public WDeviceChangeEventData {
- void* userDefined;
- };
-
- struct WVPowerDAPIDeviceChangeEventData : public WDeviceChangeEventData {
- void* power;
- };
-
- struct WNoDiskSpaceDeviceChangeEventData : public WDeviceChangeEventData {
- void* driveNumber;
- };
-
- struct WDisplayChangeEventData : public WEventData {
- WUShort BitPerPixel;
- WUShort xResolution;
- WUShort yResolution;
- };
-
- struct WDockingChangeEventData : public WEventData {
- WDockPosition oldPosition;
- WDockPosition newPosition;
- };
-
- // WShowWindowFlag equivalents for the SW_* flags in winuser.h
-
- enum WShowWindowFlag {
- WSWFHide = 0,
- WSWFShowNormal,
- WSWFShowMinimized,
- WSWFShowMaximized,
- WSWFShowNoActivate,
- WSWFShow,
- WSWFMinimize,
- WSWFShowMinNoActivate,
- WSWFShowNA,
- WSWFRestore,
- WSWFShowDefault
- };
-
- enum WPowerBroadcastPowerEvent {
- WPowerBroadcastQuerySuspend = 0x0000,
- WPowerBroadcastQueryStandBy = 0x0001,
- WPowerBroadcastSuspendFailed = 0x0002,
- WPowerBroadcastStandByFailed = 0x0003,
- WPowerBroadcastSuspend = 0x0004,
- WPowerBroadcastStandBy = 0x0005,
- WPowerBroadcastResumeCritical = 0x0006,
- WPowerBroadcastResumeSuspend = 0x0007,
- WPowerBroadcastResumeStandBy = 0x0008,
- WPowerBroadcastBatteryLow = 0x0009,
- WPowerBroadcastPowerStatusChange = 0x000a,
- WPowerBroadcastOEMEvent = 0x000b
- };
-
- enum WPowerBroadcastPowerFlag {
- WPowerBroadcastResumeFromFailure = 0x00000001
- };
-
- struct WPowerBroadcastEventData : public WEventData {
- WDWord powerEvent;
- WDWord powerData;
- };
-
- enum WSettingChangeAction {
- WSettingChangeGetBeep = 1,
- WSettingChangeSetBeep = 2,
- WSettingChangeGetMouse = 3,
- WSettingChangeSetMouse = 4,
- WSettingChangeGetBorder = 5,
- WSettingChangeSetBorder = 6,
- WSettingChangeGetKeyboardSpeed = 10,
- WSettingChangeSetKeyboardSpeed = 11,
- WSettingChangeLangDriver = 12,
- WSettingChangeIconHorizontalSpacing = 13,
- WSettingChangeGetScreenSaveTimeOut = 14,
- WSettingChangeSetScreenSaveTimeOut = 15,
- WSettingChangeGetScreenSaveActive = 16,
- WSettingChangeSetScreenSaveActive = 17,
- WSettingChangeGetGridGranularity = 18,
- WSettingChangeSetGridGranularity = 19,
- WSettingChangeSetDeskWallPaper = 20,
- WSettingChangeSetDeskPattern = 21,
- WSettingChangeGetKeyboardDelay = 22,
- WSettingChangeSetKeyboardDelay = 23,
- WSettingChangeIconVerticalSpacing = 24,
- WSettingChangeGetIconTitleWrap = 25,
- WSettingChangeSetIconTitleWrap = 26,
- WSettingChangeGetMenuDropAlignment = 27,
- WSettingChangeSetMenuDropAlignment = 28,
- WSettingChangeSetDoubleClkWidth = 29,
- WSettingChangeSetDoubleClkHeight = 30,
- WSettingChangeGetIconTitleLogFont = 31,
- WSettingChangeSetDoubleClickTime = 32,
- WSettingChangeSetMouseButtonSwap = 33,
- WSettingChangeSetIconTitleLogFont = 34,
- WSettingChangeGetFastTaskSwitch = 35,
- WSettingChangeSetFastTaskSwitch = 36,
- WSettingChangeSetDragFullWindows = 37,
- WSettingChangeGetDragFullWindows = 38,
- WSettingChangeGetNonClientMetrics = 41,
- WSettingChangeSetNonClientMetrics = 42,
- WSettingChangeGetMinimizedMetrics = 43,
- WSettingChangeSetMinimizedMetrics = 44,
- WSettingChangeGetIconMetrics = 45,
- WSettingChangeSetIconMetrics = 46,
- WSettingChangeSetWorkArea = 47,
- WSettingChangeGetWorkArea = 48,
- WSettingChangeSetPenWindows = 49,
- WSettingChangeGetHighContrast = 66,
- WSettingChangeSetHighContrast = 67,
- WSettingChangeGetKeyboardPref = 68,
- WSettingChangeSetKeyboardPref = 69,
- WSettingChangeGetScreenReader = 70,
- WSettingChangeSetScreenReader = 71,
- WSettingChangeGetAnimation = 72,
- WSettingChangeSetAnimation = 73,
- WSettingChangeGetFontSmoothing = 74,
- WSettingChangeSetFontSmoothing = 75,
- WSettingChangeSetDragWidth = 76,
- WSettingChangeSetDragHeight = 77,
- WSettingChangeSetHandHeld = 78,
- WSettingChangeGetLowPowerTimeOut = 79,
- WSettingChangeGetPowerOffTimeOut = 80,
- WSettingChangeSetLowPowerTimeOut = 81,
- WSettingChangeSetPowerOffTimeOut = 82,
- WSettingChangeGetLowPowerActive = 83,
- WSettingChangeGetPowerOffActive = 84,
- WSettingChangeSetLowPowerActive = 85,
- WSettingChangeSetPowerOffActive = 86,
- WSettingChangeSetCursors = 87,
- WSettingChangeSetIcons = 88,
- WSettingChangeGetDefaultInputLang = 89,
- WSettingChangeSetDefaultInputLang = 90,
- WSettingChangeSetLangToggle = 91,
- WSettingChangeGetWindowsExtension = 92,
- WSettingChangeSetMouseTrails = 93,
- WSettingChangeGetMouseTrails = 94,
- WSettingChangeScreenSaverRunning = 97,
- WSettingChangeGetFilterKeys = 50,
- WSettingChangeSetFilterKeys = 51,
- WSettingChangeGetToggleKeys = 52,
- WSettingChangeSetToggleKeys = 53,
- WSettingChangeGetMouseKeys = 54,
- WSettingChangeSetMouseKeys = 55,
- WSettingChangeGetShowSounds = 56,
- WSettingChangeSetShowSounds = 57,
- WSettingChangeGetStickyKeys = 58,
- WSettingChangeSetStickyKeys = 59,
- WSettingChangeGetAccessTimeOut = 60,
- WSettingChangeSetAccessTimeOut = 61,
- WSettingChangeGetSerialKeys = 62,
- WSettingChangeSetSerialKeys = 63,
- WSettingChangeGetSoundSentry = 64,
- WSettingChangeSetSoundSentry = 65
- };
-
- enum WSettingChangeFlags {
- WSettingChangeUpdateIniFile = 0x0001,
- WSettingChangeSendWinIniChange = 0x0002,
- WSettingChangeSendChange = 0x0002, // == WSettingChangeSendWinIniChange
- };
-
- struct WSettingChangeEventData : public WEventData {
- WDWord flags;
- WString metricsName;
- };
-
- struct WLangChangeEventData : public WEventData {
- WDWord charSet;
- WKeyboardHandle hkl;
- };
-
- struct WLangChangeRequestEventData : public WEventData {
- WBool sysCharSet;
- WKeyboardHandle hkl;
- };
-
- struct WScrollBarEventData;
-
- struct WSysDeadCharEventData : public WEventData {
- WUnicodeChar charCode;
- WULong keyData;
- };
-
- /**************************************************
- ******************************************************
- ***************************************************/
-
- struct WActivateEventData : public WEventData {
- WWindow * window;
- WWindowHandle handle;
- WBool causedByClick;
- };
-
- struct WActivateApplicationEventData : public WEventData {
- WDWord threadID;
- };
-
- struct WCalculateSizeEventData : public WEventData {
- WRect size;
- WBool adjust;
- };
-
- struct WCharacterPressEventData : public WEventData {
- WKeyState state;
- WChar key;
- WBool prevDown;
- WBool keyDown;
- WUInt scanCode;
- WUInt repeatCount;
- };
-
- typedef WEventData WClickEventData;
-
- struct WContextMenuEventData : public WEventData {
- WWindow * sourceWindow;
- WWindowHandle sourceHandle;
- WPoint clickedAt;
- };
-
- struct WEndSessionEventData : public WEventData {
- WBool endSession;
- WBool logoff;
- };
-
- struct WEnterIdleEventData : public WEventData {
- WBool isDialog;
- WWindow * window;
- WWindowHandle handle;
- };
-
- struct WFocusEventData : public WEventData {
- WWindow * other;
- WWindowHandle handle;
- };
-
- struct WGetCursorEventData : public WEventData {
- WHitTestCode hitTestCode;
- WEventID mouseEvent;
- };
-
- struct WHelpEventData : public WEventData {
- WULong helpID;
- WULong objectID;
- WULong handle;
- WBool menuHelp;
- };
-
- struct WHitTestEventData : public WEventData {
- WPoint newPosition;
- WHitTestCode hitTestCode;
- };
-
- struct WKeyPressEventData : public WEventData {
- WKeyState state;
- WKeyPressCode key;
- WBool prevDown;
- WBool keyDown;
- WUInt scanCode;
- WUInt repeatCount;
- };
-
- struct WMessageEventData : public WEventData, public WMessage {
- };
-
- struct WMouseEventData : public WEventData {
- WPoint newPosition;
- WMouseFlags mouseFlags;
- };
-
- struct WMoveEventData : public WEventData {
- WPoint newPosition;
- };
-
- struct WPaintEventData : public WEventData {
- WDisplayCanvas * canvas;
- };
-
- struct WPaletteChangedEventData : public WEventData {
- WWindow * window;
- WWindowHandle handle;
- };
-
- struct WQueryEndSessionEventData : public WEventData {
- WUInt source;
- WBool logoff;
- };
-
- struct WResizeEventData : public WEventData {
- WRect newPosition;
- WRect oldPosition;
- WBool minimizing;
- WBool maximizing;
- };
-
- struct WToolTipTextEventData : public WEventData {
- WWindow * source;
- WULong id;
- WString string;
- };
-
- struct WUserEventData : public WEventData {
- WULong data;
- };
-
- // Flags for print events
-
- #define WPEDF_CHECKVISIBLE 0x01L
- #define WPEDF_NONCLIENT 0x02L
- #define WPEDF_CLIENT 0x04L
- #define WPEDF_ERASEBKGND 0x08L
- #define WPEDF_CHILDREN 0x10L
- #define WPEDF_OWNED 0x20L
-
- struct WPrintEventData : public WEventData {
- WCanvas *canvas;
- WULong flags;
- };
-
- typedef WPrintEventData WPrintClientEventData;
-
- struct WHotKeyInfo {
- WKeyState state;
- WKeyPressCode code;
- };
-
- typedef WULong WDialogCode;
-
- #define WDefaultSize (0x80000000)
-
- #define WDLGCodeWantArrows (0x0001)
- #define WDLGCodeWantTab (0x0002)
- #define WDLGCodeWantAllKeys (0x0004)
- #define WDLGCodeWantMessage (0x0004)
- #define WDLGCodeHasSetSel (0x0008)
- #define WDLGCodeDefPushButton (0x0010)
- #define WDLGCodeUnDefPushButton (0x0020)
- #define WDLGCodeRadioButton (0x0040)
- #define WDLGCodeWantChars (0x0080)
- #define WDLGCodeStatic (0x0100)
- #define WDLGCodeButton (0x2000)
-
- //
- // Window styles
- //
-
- #define WSDefault ((WStyle)0x10CF0000L) // WS_OVERLAPPEDWINDOW|WS_VISIBLE
-
- #define WSVisible ((WStyle)0x10000000L) // WS_VISIBLE
- #define WSDisabled ((WStyle)0x08000000L) // WS_DISABLED
- #define WSCaption ((WStyle)0x00C00000L) // WS_CAPTION
- #define WSClipChildren ((WStyle)0x02000000L) // WS_CLIPCHILDREN
- #define WSClipSiblings ((WStyle)0x04000000L) // WS_CLIPSIBLINGS
- #define WSMinimize ((WStyle)0x20000000L) // WS_MINIMIZE
- #define WSMaximize ((WStyle)0x01000000L) // WS_MAXIMIZE
- #define WSHScroll ((WStyle)0x00100000L) // WS_HSCROLL
- #define WSVScroll ((WStyle)0x00200000L) // WS_VSCROLL
- #define WSSizeable ((WStyle)0x00040000L) // WS_THICKFRAME
- #define WSBorder ((WStyle)0x00800000L) // WS_BORDER
- #define WSDlgBorder ((WStyle)0x00400000L) // WS_DLGFRAME
- #define WSDlgFrame ((WStyle)0x00400000L) // WS_DLGFRAME
- #define WSSysMenu ((WStyle)0x00080000L) // WS_SYSMENU
- #define WSSystemMenu ((WStyle)0x00080000L) // WS_SYSMENU
- #define WSOverlapped ((WStyle)0x00000000L) // WS_OVERLAPPED
- #define WSPopup ((WStyle)0x80000000L) // WS_POPUP
- #define WSChild ((WStyle)0x40000000L) // WS_CHILD
- #define WSMinimizeBox ((WStyle)0x00020000L) // WS_MINIMIZEBOX
- #define WSMaximizeBox ((WStyle)0x00010000L) // WS_MAXIMIZEBOX
- #define WSGroup ((WStyle)0x00020000L) // WS_GROUP
- #define WSTabStop ((WStyle)0x00010000L) // WS_TABSTOP
- #define WSResizeBorder ((WStyle)0x00040000L) // WS_THICKFRAME
-
- #define WSExAcceptDropFile ((WStyle)0x00000010L) // WS_EX_ACCEPTFILES
- #define WSExAcceptFiles ((WStyle)0x00000010L) // WS_EX_ACCEPTFILES
- #define WSExDlgModalFrame ((WStyle)0x00000001L) // WS_EX_DLGMODALFRAME
- #define WSExNoParentNotify ((WStyle)0x00000004L) // WS_EX_NOPARENTNOTIFY
- #define WSExTopmost ((WStyle)0x00000008L) // WS_EX_TOPMOST
- #define WSExTransparent ((WStyle)0x00000020L) // WS_EX_TRANSPARENT
- #define WSExMDIChild ((WStyle)0x00000040L) // WS_EX_MDICHILD
- #define WSExToolWindow ((WStyle)0x00000080L) // WS_EX_TOOLWINDOW
- #define WSExWindowEdge ((WStyle)0x00000100L) // WS_EX_WINDOWEDGE
- #define WSExClientEdge ((WStyle)0x00000200L) // WS_EX_CLIENTEDGE
- #define WSExContextHelp ((WStyle)0x00000400L) // WS_EX_CONTEXTHELP
- #define WSExRight ((WStyle)0x00001000L) // WS_EX_RIGHT
- #define WSExLeft ((WStyle)0x00000000L) // WS_EX_LEFT
- #define WSExLTRReading ((WStyle)0x00000000L) // WS_EX_LTRREADING
- #define WSExRTLReading ((WStyle)0x00002000L) // WS_EX_RTLREADING
- #define WSExLeftScrollbar ((WStyle)0x00004000L) // WS_EX_LEFTSCROLLBAR
- #define WSExRightScrollbar ((WStyle)0x00000000L) // WS_EX_RIGHTSCROLLBAR
- #define WSExControlParent ((WStyle)0x00010000L) // WS_EX_CONTROLPARENT
- #define WSExStaticEdge ((WStyle)0x00020000L) // WS_EX_STATICEDGE
- #define WSExAppWindow ((WStyle)0x00040000L) // WS_EX_APPWINDOW
-
- class WCMCLASS WWindow : public WEventGenerator {
- WDeclareSubclass( WWindow, WEventGenerator );
-
- public:
-
- /**************************************************************
- * Constructors and destructors
- **************************************************************/
-
- WWindow();
- WWindow( WWindow *parent, WWindowHandle hdl=NULLHWND );
- WWindow( WWindow *parent, WUInt id, WWindowHandle hdl=NULLHWND );
-
- ~WWindow();
-
- /**************************************************************
- * Properties
- **************************************************************/
-
- // AcceptDropFile
-
- virtual WBool GetAcceptDropFile() const;
- virtual WBool SetAcceptDropFile( WBool acceptDropFile );
-
- // AlwaysOnTop
-
- WBool GetAlwaysOnTop() const;
- WBool SetAlwaysOnTop( WBool alwaysOnTop );
-
- // BackColor
-
- virtual WColor GetBackColor( WBool getResultingColor=TRUE ) const;
- virtual WBool SetBackColor( const WColor & backColor );
-
- // Capture
-
- WBool GetCapture() const;
- WBool SetCapture( WBool capture=TRUE );
-
- // ClientRectangle
-
- WRect GetClientRectangle( WBool absolute=FALSE ) const;
-
- // DefaultStyle
-
- virtual WStyle GetDefaultStyle() const;
-
- // DefaultExtendedStyle
-
- virtual WStyle GetDefaultExtendedStyle() const;
-
- // Dockable
-
- WBool GetDockable() const;
- WBool SetDockable( WBool dockable );
-
- // DockableAtPosition
-
- WBool GetDockableAtPosition( WDockPosition pos ) const;
- WBool SetDockableAtPosition( WBool dockable, WDockPosition pos );
-
- // DockedFrame
-
- WDockFloatingForm *GetDockedFrame() const;
- WBool SetDockedFrame( WDockFloatingForm * frame );
-
- // DockedIndex
-
- WBool SetDockedIndex( WInt index );
- WInt GetDockedIndex() const;
-
- // DockedMinimumSize
-
- virtual WSize GetDockedMinimumSize() const;
-
- // DockedOffset
-
- WInt GetDockedOffset() const;
- WBool SetDockedOffset( WInt offset );
-
- // DockedParent
-
- virtual WForm *GetDockedParent() const;
- virtual WBool SetDockedParent( WForm * dockedParent );
-
- // DockedPosition
-
- virtual WDockPosition GetDockedPosition();
- virtual void SetDockedPosition( WDockPosition pos, WInt index=0,
- WBool insert=FALSE,
- WWindow * sibling=NULL,
- WBool insertBeforeSibling=TRUE,
- WBool callEventHandler=TRUE );
-
- // DockDragging
-
- WBool SetDockDragging( WBool dockDragging );
- WBool GetDockDragging() const;
-
- // DockDragStarting
-
- WBool SetDockDragStarting( WBool dockDragStarting );
- WBool GetDockDragStarting() const;
-
- // DockWrappable
-
- WBool GetDockWrappable() const;
- WBool SetDockWrappable( WBool wrappable );
-
- // DialogCode
-
- virtual WULong GetDialogCode( WUInt wParam = 0, WLong lParam = 0 );
-
- // DragMode
-
- WDragMode GetDragMode() const;
- virtual WBool SetDragMode( WDragMode mode );
-
- // DragSourceTag
- //
- // If not a null/empty string, identifies the window as a
- // drag source and describes the tag to be used to
- // fill the structures for DragEvent.
-
- WString GetDragSourceTag() const;
- WBool SetDragSourceTag( const WString & tag );
-
- // DragTargetTag
- //
- // If not a null string, identifies the tags that
- // the window accepts for drag operations. A '*' means all,
- // a null/empty string means none.
-
- WString GetDragTargetTag() const;
- WBool SetDragTargetTag( const WString & tag );
-
- // Enabled
-
- virtual WBool SetEnabled( WBool enabled );
- virtual WBool GetEnabled() const;
-
- // ExtendedStyle
-
- WStyle GetExtendedStyle() const;
- WBool SetExtendedStyle( WStyle style, WBool clone );
- WBool SetExtendedStyle( WStyle style );
-
- // Focus
-
- WBool SetFocus( WBool focus=TRUE );
- WBool GetFocus() const;
-
- // Font
-
- virtual WBool SetFont( const WFont & font, WBool preserveSize=TRUE );
- virtual WFont GetFont( WBool getResultingFont=TRUE );
-
- // ForeColor
-
- virtual WColor GetForeColor( WBool getResultingColor=TRUE ) const;
- virtual WBool SetForeColor( const WColor & foreColor );
-
- // Handle
-
- WWindowHandle GetHandle() const { return _handle; }
- WBool SetHandle( WWindowHandle handle );
-
- // Height
-
- virtual WInt GetHeight() const;
- virtual WBool SetHeight( const WInt & height, WBool update=TRUE );
-
- // HelpID
-
- virtual WULong GetHelpID() const;
- virtual WBool SetHelpID( WULong helpID );
-
- // HotKey
-
- WHotKeyInfo GetHotKey();
- WBool SetHotKey( const WHotKeyInfo & hotKey );
- WBool SetHotKey( WHotKey *hotKey );
-
- // InputContext
-
- virtual WInputContext GetInputContext() const;
-
- // InputMode
-
- virtual WDWord GetInputMode() const;
- virtual WBool SetInputMode( WDWord mode );
-
- // Left
-
- virtual WInt GetLeft() const;
- virtual WBool SetLeft( const WInt & left, WBool update=TRUE );
-
- // Name
-
- virtual WString GetName() const;
- virtual WBool SetName( const WString & name );
-
- // Owner
-
- WWindow *GetOwner() const;
-
- // Painting
-
- virtual WBool GetPainting() const;
- virtual WBool SetPainting( WBool painting, WBool forceRedraw=TRUE,
- WBool update=FALSE );
-
- // Parent
-
- virtual WWindow *GetParent() const;
- virtual WBool SetParent( const WWindow * parent );
-
- // Popup
-
- virtual WPopupMenu *GetPopup();
- virtual WBool SetPopup( WPopupMenu * popup );
-
- // Rectangle
-
- virtual WRect GetRectangle( WBool absolute=FALSE ) const;
- virtual WBool SetRectangle( const WRect & rectangle,
- WBool update=TRUE );
-
- // RegisteredClass
-
- virtual const WChar *GetRegisteredClass();
-
- // Style
-
- WStyle GetStyle() const;
- virtual WBool SetStyle( WStyle style, WBool clone );
- virtual WBool SetStyle( WStyle style );
-
- // Text
-
- virtual WString GetText() const;
- virtual WBool SetText( const WString & text );
-
- // TextLength
-
- virtual size_t GetTextLength() const;
-
- // ToolTip
-
- virtual WToolTip *GetToolTip() const;
- virtual WBool SetToolTip( WToolTip * toolTip );
-
- // ToolTipText
-
- WString GetToolTipText() const;
- virtual WBool SetToolTipText( const WString & toolTipText );
-
- // Top
-
- virtual WInt GetTop() const;
- virtual WBool SetTop( const WInt & top, WBool update=TRUE );
-
- // Topmost
-
- WBool SetTopmost( WBool topmost );
- WBool GetTopmost() const;
-
- // UserData
-
- virtual void *GetUserData() const;
- virtual WBool SetUserData( void * userData );
-
- // Valid
-
- WBool GetValid();
-
- // Visible
-
- virtual WBool GetVisible() const;
- virtual WBool SetVisible( WBool visible );
-
- // Width
-
- virtual WInt GetWidth() const;
- virtual WBool SetWidth( const WInt & width, WBool update=TRUE );
-
- // WindowID
-
- virtual WUInt GetWindowID() const;
- virtual WBool SetWindowID( WUInt windowID );
-
- // WindowPlacement
-
- WWindowPlacement GetWindowPlacement() const;
- WBool SetWindowPlacement( const WWindowPlacement & windowPlacement,
- WBool restoreToMaximized=FALSE,
- WBool setMinimizedPosition=TRUE );
-
- // ZOrder
-
- virtual WUInt GetZOrder() const;
- virtual WBool SetZOrder( WUInt zorder );
-
-
- /**************************************************************
- * Methods
- **************************************************************/
-
- // AdjustFloatingFormStyle
-
- virtual WBool AdjustFloatingFormStyle( WStyle & style,
- WStyle & exStyle );
-
- // AttachToWindow
- //
- // Attach the object to an arbitrary window handle, which
- // might represent a window created by someone else. Set
- // "destroy" to true if you want the window to be destroyed
- // when the object is destroyed. Set "subclass" to true if
- // you want the window handle subclassed (in the Win32 sense)
- // and thus see its events. If the window handle belongs to
- // another process set "destroy" and "subclass" to false.
-
- virtual WBool AttachToWindow( WWindowHandle handle, WBool destroy,
- WBool subclass=TRUE );
-
- // BringToTop
-
- virtual WBool BringToTop();
-
- // CalculateSize
-
- virtual WRect CalculateSize( const WRect & size, WBool adjust );
-
- // ChangeStyle
-
- WBool ChangeStyle( WStyle style, WBool on, WBool clone );
- WBool ChangeStyle( WStyle style, WBool on );
-
- // ChangeExtendedStyle
-
- WBool ChangeExtendedStyle( WStyle style, WBool on, WBool clone );
- WBool ChangeExtendedStyle( WStyle style, WBool on );
-
- // ClipMouse
-
- WBool ClipMouse( const WRect & clipRectangle, WBool absolute=FALSE );
-
- // Create
- //
- // Create a window.
-
- WBool Create( WWindow *parent );
- WBool Create( WWindow *parent, const WChar *text );
- WBool Create( WWindow *parent, const WChar *text, void *data );
- WBool Create( WWindow * parent, const WRect & rectangle,
- const WChar * text=NULL, void * data=NULL );
- WBool Create( WWindow * parent, const WRect & rectangle,
- const WChar * text, WStyle style,
- WStyle exStyle, void * data=NULL );
- WBool Create( WWindow * parent, const WResourceID & id,
- WModuleHandle module=_ApplicationModule );
-
- // CreateToolTip
-
- WBool CreateToolTip( WBool rectangleBased=FALSE,
- WLong rectangleBasedId=1 );
-
- // Destroy
-
- virtual WBool Destroy();
-
- // DetachFromWindow
- //
- // Detaches the object from the window handle, if any.
- // Does not destroy the window, but will undo any subclassing
- // that was done with AttachToWindow.
-
- virtual WWindowHandle DetachFromWindow();
-
- // EnableScrollBar
-
- WBool EnableScrollBar( WScrollDir bar, WBool enable=TRUE );
-
- // FindDragSource
- //
- // After the user has signalled a drag, call this routine to
- // find out if anyone actually wants to start a drag or not.
- // Returns NULL if no one does, otherwise returns the object
- // whose StartDrag method should be called. Note that this
- // routine may call one or more DragStart events. The
- // structures will be initialized appropriately for passing
- // to the StartDrag method.
-
- WWindow *FindDragSource( WDragEventData & event, WDragInfo *dragInfo );
-
-
- // InDragScrollInset
- //
- // Returns TRUE if the given point is in the drag scroll
- // inset for the window. Point can be given in client
- // or screen coordinates.
-
- virtual WBool InDragScrollInset( const WPoint & point,
- WBool absolute ) const;
-
- // InitializeClass
- //
- // A virtual function whose task is twofold:
- // a) to register the class (once only)
- // b) to return the name of the class
-
- virtual const WChar *InitializeClass();
-
- // Invalidate
-
- WBool Invalidate( WBool erase=TRUE );
- WBool Invalidate( const WRect & rectangle, WBool erase=TRUE );
- WBool Invalidate( const WRegion & region, WBool erase=TRUE );
-
- // InvokeHelp
- //
- // Simulates the user pressing F1 for the window.
-
- WBool InvokeHelp() const;
-
- // Move
-
- virtual WBool Move( const WRect & rectangle, WBool update=TRUE );
- virtual WBool Move( const WRect & rectangle, WDeferMoveHandle & dwp );
- virtual WBool Move( const WPoint & point, WBool update=TRUE );
- virtual WBool Move( const WPoint & point, WDeferMoveHandle & dwp );
-
- // PostMessage
-
- WLong PostMessage( const WMessage & msg ) const;
-
- // PostUserEvent
- //
- // Post a user-defined "event" (a 32-bit value) which
- // is to be processed by the target window's "User" event.
- // The event is posted to the message queue and thus
- // can be used across threads.
-
- WBool PostUserEvent( WWindow * postTo, WULong data );
-
- // Scroll
-
- virtual WBool Scroll( const WPoint & amount, WRect * toScroll=NULL,
- WRect * clipRegion=NULL );
-
- // SendMessage
-
- WLong SendMessage( const WMessage & msg ) const;
-
- // StartDrag
- //
- // Used to actually start a dragging operation. Captures
- // mouse input until the given mouse button is released
- // or escape is pressed (or the DragContinue event returns
- // a cancel). If no draginfo is provided, default values
- // are used. If targetDragOver is TRUE, the target object
- // will get DragEnter/DragOver/DragLeave/DragDrop events.
- // If sourceDragOver is TRUE, the source will also get
- // these events as if they were being sent to the drag target.
-
- WBool StartDrag( WDragEventData & event,
- WULong whichButton=WMK_LBUTTON,
- WDragInfo *draginfo=NULL,
- WBool sourceDragOver=FALSE,
- WBool targetDragOver=TRUE );
- WBool StartDrag( WULong whichButton=WMK_LBUTTON,
- WDragInfo *draginfo=NULL,
- WBool sourceDragOver=FALSE,
- WBool targetDragOver=TRUE );
-
- // StartFakeDrag
- //
- // Simulates a dragging operation between two windows.
- // Calls DragStart event at the beginning and then
- // DragEnd at the end. In between, calls DragEnter,
- // DragOver, DragDrop for either or both the source
- // and target windows. DragContinue, DragFeedback
- // DragLeave and DragScroll are never called.
-
- WBool StartFakeDrag( WWindow *target, WDragEventData & event,
- WULong whichButton=WMK_LBUTTON,
- WDragInfo *draginfo=NULL,
- WBool sourceDragOver=FALSE,
- WBool targetDragOver=TRUE );
- WBool StartFakeDrag( WWindow *target,
- WULong whichButton=WMK_LBUTTON,
- WDragInfo *draginfo=NULL,
- WBool sourceDragOver=FALSE,
- WBool targetDragOver=TRUE );
-
- // Update
-
- virtual WBool Update( WBool force=FALSE );
-
- // UnClipMouse
-
- WBool UnClipMouse();
-
- // Validate
-
- WBool Validate();
- WBool Validate( const WRect & rectangle );
- WBool Validate( const WRegion & region );
-
- /**************************************************************
- * Item Properties
- **************************************************************/
-
- // ScrollIncrement
-
- virtual WLong GetScrollIncrement( WScrollDir bar ) const;
- virtual WBool SetScrollIncrement( WScrollDir bar, WLong increment );
-
- // ScrollPosition
-
- virtual WBool SetScrollPosition( WScrollDir bar, WInt pos,
- WBool redraw=TRUE );
- virtual WInt GetScrollPosition( WScrollDir bar );
-
- // ScrollRange
-
- virtual WBool SetScrollRange( WScrollDir bar, const WRange & range,
- WBool redraw=TRUE );
- virtual WRange GetScrollRange( WScrollDir bar ) const;
-
- // ScrollStep
-
- virtual WLong GetScrollStep( WScrollDir bar ) const;
- virtual WBool SetScrollStep( WScrollDir bar, WLong step );
-
- // ScrollPageSize
-
- virtual WBool SetScrollPageSize( WScrollDir bar, const WInt & psize );
- virtual WInt GetScrollPageSize( WScrollDir bar ) const;
-
- /**************************************************************
- * Static Properties
- **************************************************************/
-
- // ActiveWindow
- //
- // Returns the WWindow that corresponds to the active window
- // in the current thread. Equivalent to calling
- // FindWindow( GetActiveWindowHandle() ).
-
- static WWindow *GetActiveWindow();
-
- // ActiveWindowHandle
- //
- // The window handle of the thread's active window. When
- // setting, the return value is the handle of the window
- // that was already active.
-
- static WWindowHandle GetActiveWindowHandle();
- static WWindowHandle SetActiveWindowHandle( WWindowHandle hWnd );
-
- // DefaultWindowClassName
- //
- // Sets the name used to register the internal window class
- // that the library uses. Call this before any forms get
- // created (such as in the application object's start event).
- // This will not change the class name used by dialogs.
-
- static WString GetDefaultWindowClassName();
- static WBool SetDefaultWindowClassName( const WString & name );
-
- // FocusWindow
- //
- // Returns the WWindow that corresponds to the focus window.
- // Equivalent to calling FindWindow( GetFocusWindowHandle() ).
-
- static WWindow *GetFocusWindow();
-
- // FocusWindowHandle
- //
- // The window handle of the thread's focus window. When
- // setting, the return value is the handle of the window
- // that already had the focus.
-
- static WWindowHandle GetFocusWindowHandle();
- static WWindowHandle SetFocusWindowHandle( WWindowHandle hWnd );
-
- // ForegroundWindowHandle
- //
- // The window handle of the foreground window.
-
- static WWindowHandle GetForegroundWindowHandle();
- static WBool SetForegroundWindowHandle( WWindowHandle hWnd );
-
- // LastActivePopupWindow
- //
- // Returns the handle of the last active popup window
- // given an owner window. If no active popup window,
- // returns the owner window.
-
- static WWindowHandle GetLastActivePopupWindow( WWindowHandle owner );
-
- /**************************************************************
- * Static Methods
- **************************************************************/
-
- // AcceptsDropFile
-
- static WWindowHandle AcceptsDropFile( WWindowHandle handle );
-
- // AddWindowProperty
- //
- // Add a named property (an "int" value) to a window handle.
-
- static WBool AddWindowProperty( WWindowHandle handle,
- const WChar *name,
- int value );
-
- // ActivatePreviousInstance
- //
- // Given a window handle found by calling something
- // like FindWindowByName, activate and restore it and
- // its active popup and optionally bring it to the foreground.
-
- static WBool ActivatePreviousInstance( WWindowHandle hWnd,
- WBool foreground=FALSE );
-
- // BeginDeferMove
-
- static WDeferMoveHandle BeginDeferMove( WInt numWindows=0 );
-
- // BringWindowToTop
-
- static WBool BringWindowToTop( WWindowHandle hWnd );
-
- // DeleteWindowProperty
- //
- // Remove a window property.
-
- static int DeleteWindowProperty( WWindowHandle handle,
- const WChar *name );
-
- // DropFile
-
- static WBool DropFile( WWindowHandle handle, WArray<WString> files );
- static WBool DropFile( WWindowHandle handle, WArray<WString> files,
- const WPoint & pt, WBool inNonClientArea,
- WBool useUnicode );
-
- // EndDeferMove
-
- static WBool EndDeferMove( WDeferMoveHandle dwp );
-
- // FindWindow
- //
- // Return the WWindow pointer that corresponds to a given
- // window handle. Returns NULL if the window does not
- // have a corresponding WWindow OR if the window belongs
- // to another process or is invalid.
-
- static WWindow * FindWindow( WWindowHandle hdl );
-
- // FindWindowByName
- //
- // Searches for a window that has a specific window class
- // and optionally a title. Returns a raw window handle
- // which you can then use with AttachToWindow to attach to
- // a WWindow object. Under Win32 you can specify optional
- // parameters for searching from a specific parent window
- // and after a specific child window. (A null value for
- // the parent means search top-level windows.)
-
- static WWindowHandle FindWindowByName( const WChar *className,
- const WChar *title=NULL,
- WWindowHandle parent=0,
- WWindowHandle afterChild=0 );
-
- // FindWindowProperty
- //
- // Return the value of a window property.
-
- static int FindWindowProperty( WWindowHandle handle,
- const WChar *name );
-
- // HitText
-
- static WHitTestCode HitTest( WWindowHandle handle,
- const WPoint & pt );
-
- // IsMaximized
- //
- // Returns TRUE if the given window handle is maximized.
-
- static WBool IsMaximized( WWindowHandle handle );
-
- // IsMinimized
- //
- // Returns TRUE if the given window handle is minimized.
-
- static WBool IsMinimized( WWindowHandle handle );
-
- // MapWindowPoint
-
- static WBool MapWindowPoint( WWindow * source, WWindow * dest,
- WPoint & pt );
-
- // ShowWindow
-
- static WBool ShowWindow( WWindowHandle hWnd, WShowWindowFlag flag );
-
- /**************************************************************
- * Message processing
- **************************************************************/
-
- virtual WBool ProcessMessage( const WMessage & msg,
- WLong & returns );
-
- virtual WBool DefaultProcess( const WMessage & msg,
- WLong & returns );
-
- virtual WBool CallNextWindowProcedure( const WMessage & msg,
- WLong & returns );
-
- virtual WBool ProcessCommand( WUInt id, WNotify code, WNotifyInfo info,
- WLong & returns );
-
- virtual WBool ProcessNotify( WUInt id, WNotify code, WNotifyInfo info,
- WLong & returns );
-
- /**************************************************************
- * Creation functions
- **************************************************************/
-
- public:
- virtual void * GetTargetWindowProc() const;
-
- virtual WInt GetTargetOffset() const;
-
-
- virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
- void * data=NULL );
-
- protected:
-
- void GetWindowStyles( WStyle & normal, WStyle & extended ) const;
-
- void ResetWindowStyles();
-
- virtual void CopyWindowData( WWindowHandle oldWin,
- WWindowHandle newWin );
-
- virtual WBool LoadWindow( WWindow * parent,
- const WResourceID & id,
- WModuleHandle module=_ApplicationModule );
-
- virtual WBool MakeWindow( WWindow * parent, WUInt id,
- const WChar *className,
- const WChar *title, const WRect & r,
- WStyle wstyle, WStyle exStyle,
- void * data=NULL );
-
- virtual WBool DoStartDrag( WDragEventData & event,
- WULong whichButton,
- WDragInfo *draginfo,
- WBool sourceDragOver,
- WBool targetDragOver );
-
- virtual WBool DoStartFakeDrag( WWindow *, WDragEventData & event,
- WULong whichButton,
- WDragInfo *draginfo,
- WBool sourceDragOver,
- WBool targetDragOver );
-
- virtual void EventNotice( WEventID id, WEventNotice type );
-
- WLong FastSendMessage( WUInt msg, WUInt wParam, WLong lParam ) const;
-
- WBool CreateInputContext( WWindowHandle winHandle );
- WBool AssociateInputContext( WWindowHandle winHandle );
- WBool DestroyInputContext( WWindowHandle winHandle );
-
- /**************************************************************
- * Event handlers
- **************************************************************/
-
- public:
-
- WBool DestroyEventHandler( WWindow * window, WEventData * event );
- WBool CommandEventHandler( WWindow * window,
- WMessageEventData * event );
- WBool NotifyEventHandler( WWindow * window,
- WMessageEventData * event );
- WBool InitPopupMenuEventHandler( WWindow * window,
- WMessageEventData * event );
- WBool PrivateMessageEventHandler( WWindow * window,
- WMessageEventData * event );
- WBool ControlColorEventHandler( WWindow * window,
- WMessageEventData * event );
- WBool NeedToolTipTextEventHandler( WWindow * source,
- WToolTipTextEventData * event );
- WBool MenuSelectEventHandler( WWindow * window,
- WMessageEventData * event );
- WBool RightButtonDownHandler( WWindow * window,
- WMouseEventData * event );
- WBool LeftButtonDownHandler( WWindow * window,
- WMouseEventData * event );
- WBool RightButtonUpHandler( WWindow * window,
- WMouseEventData * event );
- WBool ContextMenuHandler( WWindow * window,
- WEventData * event );
- WBool ContextHelpHandler( WWindow * window,
- WHelpEventData * event );
- WBool DockLeftButtonUpHandler( WWindow * window,
- WMouseEventData * event );
- WBool DockLeftButtonDownHandler( WWindow * window,
- WMouseEventData * event );
- WBool DockMouseMoveHandler( WWindow * window,
- WMouseEventData * event );
- WBool DockKeyDownEventHandler( WWindow * window,
- WKeyPressEventData * event );
- WBool ScrollEventHandler( WWindow * window,
- WScrollBarEventData * event );
- WBool DummyEventHandler( WWindow * window,
- WEventData * event );
-
- // Default handlers for drag sources...
-
- virtual WBool WantsDragMessage( WULong whichButton ) const;
- virtual WBool FillDragEventData( WDragEventData & event ) const;
-
- WBool DragStartHandler( WWindow *window, WDragEventData *event );
- WBool DragContinueHandler( WWindow *window, WDragEventData *event );
- WBool DragFeedbackHandler( WWindow *window, WDragEventData *event );
- WBool DragEndHandler( WWindow *window, WDragEventData *event );
- WBool DragFillHandler( WWindow *window, WDragEventData *event );
-
- WBool DragEnterHandler( WWindow *window, WDragEventData *event );
- WBool DragOverHandler( WWindow *window, WDragEventData *event );
- WBool DragLeaveHandler( WWindow *window, WDragEventData *event );
- WBool DragDropHandler( WWindow *window, WDragEventData *event );
-
- /**************************************************************
- * Other
- **************************************************************/
-
- virtual WBool SetEventHandler( WEventID id, WObject * object,
- WEventHandler handler,
- void * userdata=NULL,
- WInt * index=NULL );
-
- int operator==( const WWindow & obj ) const;
- int operator!=( const WWindow & obj ) const;
-
- virtual void SetClassIcon( const WResourceID & id );
-
- virtual WBool SelectControlColors( WDeviceHandle handle,
- WBrushHandle * backBrush,
- WBool backOnly,
- WBool setDefaults=TRUE,
- WColor * backColor=NULL,
- WColor * foreColor=NULL,
- WBool queryOnlyMode=FALSE );
-
- WCursor SetCursor( const WCursor & cursor, WBool persistent=FALSE );
-
- WBool IsVisible();
-
- WBool IsEnabled();
-
- WBool SetCurrentPopupMenu( WPopupMenu *popup );
- WPopupMenu *GetCurrentPopupMenu() const;
-
- virtual WBool OnMouseMessage( const WMessage & msg );
-
- virtual WBool RelayToTooltip( const WMessage & msg );
-
- virtual WUInt AssignWindowID();
-
- virtual WBool FilterMessage( WMessage & msg, WBool & eatMessage );
-
- virtual void AddControl( WControl * ctrl );
- virtual void RemoveControl( WControl * ctrl );
-
- virtual WBool IgnoreDeleteItem();
-
- private:
-
- void CommonInit();
-
- public:
-
- WBool LocalProcessGetDialogCode( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessPaint( const WMessage & msg, WLong & returns );
- WBool LocalProcessNCButton( const WMessage & msg, WLong & returns );
- WBool LocalProcessButton( const WMessage & msg, WLong & returns );
- WBool LocalProcessNCHitTest( const WMessage & msg, WLong & returns );
- WBool LocalProcessDropFiles( const WMessage & msg, WLong & returns );
- WBool LocalProcessScroll( const WMessage & msg, WLong & returns );
- WBool LocalProcessInitMenuPopup( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessMenuSelect( const WMessage & msg, WLong & returns );
- WBool LocalProcessEnterIdle( const WMessage & msg, WLong & returns );
- WBool LocalProcessEnterSizeMove( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessExitSizeMove( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessEraseBackground( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessDeleteItem( const WMessage & msg, WLong & returns );
- WBool LocalProcessMeasureItem( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessCompareItem( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessDrawItem( const WMessage & msg, WLong & returns );
- WBool LocalProcessNCPaint( const WMessage & msg, WLong & returns );
- WBool LocalProcessEndSession( const WMessage & msg, WLong & returns );
- WBool LocalProcessQueryEndSession( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessWindowPosChanging( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessWindowPosChanged( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessCtlColor( const WMessage & msg, WLong & returns );
- WBool LocalProcessShowWindow( const WMessage & msg, WLong & returns );
- WBool LocalProcessCreate( const WMessage & msg, WLong & returns );
- WBool LocalProcessDestroy( const WMessage & msg, WLong & returns );
- WBool LocalProcessSetCursor( const WMessage & msg, WLong & returns );
- WBool LocalProcessFocus( const WMessage & msg, WLong & returns );
- WBool LocalProcessActivate( const WMessage & msg, WLong & returns );
- WBool LocalProcessActivateApplication( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessSysCommand( const WMessage & msg, WLong & returns );
- WBool LocalProcessCommand( const WMessage & msg, WLong & returns );
- WBool LocalProcessQueryNewPalette( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessPaletteChanged( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessMove( const WMessage & msg, WLong & returns );
- WBool LocalProcessSize( const WMessage & msg, WLong & returns );
- WBool LocalProcessSysKeyDown( const WMessage & msg, WLong & returns );
- WBool LocalProcessKeyDown( const WMessage & msg, WLong & returns );
- WBool LocalProcessKeyUp( const WMessage & msg, WLong & returns );
- WBool LocalProcessChar( const WMessage & msg, WLong & returns );
- WBool LocalProcessSysDeadChar( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessSysColorChange( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessNotify( const WMessage & msg, WLong & returns );
- WBool LocalProcessContextMenu( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessHelp( const WMessage & msg, WLong & returns );
- WBool LocalProcessMultiMedia( const WMessage & msg, WLong & returns );
- WBool LocalProcessCaptureChanged( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessDeviceChange( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessDisplayChange( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessPower( const WMessage & msg, WLong & returns );
- WBool LocalProcessSettingChange( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessUserChanged( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessInputLangChange( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessInputLangChangeRequest( const WMessage & msg,
- WLong & returns );
- WBool LocalProcessPrint( const WMessage & msg, WLong & returns );
-
- /**************************************************************
- * Data members
- **************************************************************/
-
- protected:
-
- class WDragTagData {
- public:
- WDragTagData();
- ~WDragTagData();
-
- WString _source;
- WString _target;
- };
-
- WVector<WWindow> * _children;
- WULong _flags;
- WStyle _styles;
- WStyle _exStyles;
- WWindowHandle _handle;
- WCallbackProc _prevWindowProc;
- WCallbackProc _currWindowProc;
- void * _userData;
- WPopupMenu * _currentPopup;
- WPopupMenu * _popupMenu;
- WFont * _textFont;
- WRect _storeRect;
- WRect _storeClientRect;
- WDragTagData * _dragTags;
- WColor * _backColor;
- WBrush * _backBrush;
- WColor * _foreColor;
- WDWord _wwinEventBits;
- WDWord _threadID;
- WBool _fastSend;
-
- private:
-
- WWindow * _parent;
- WUInt _windowID;
- WToolTip * _toolTip;
- WDragMode _dragMode;
- WBool _dockable;
- WForm * _dockedParent;
- WString * _toolTipText;
- WString * _name;
- WCursorHandle _cursorHandle;
- WLong _increment[2];
- WLong _step[2];
-
- WDockFloatingForm * _dockedFrame;
- WInt _dockedOffset;
- WDockPosition _dockPosition;
- WInt _dockedIndex;
- WBool _dockDragging;
- WBool _dockableAtPos[6];
- WBool _dockWrap;
- WBool _dockDragStarting;
- WULong _helpId;
- WInputContext _inputContext;
- WInputContextHandle _oldInputContextHandle;
- };
-
- extern template WVector<WWindow>;
-
- struct WDropFileEventData : public WEventData {
- WPoint dropPoint; // mouse position
- WStringArray fileName;
- // Note: These two members are technically redundant, but here for
- // backwards compatibility and ease of use
- WULong numFiles;
- WChar ** fileNames;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WWINDOW_HPP_INCLUDED
-